import 'package:baselib/util/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_app/controller/MineControl.dart';
import 'package:get/get.dart';
class MyInfoPage extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return new MyInfoPageState();
  }

}

class MyInfoPageState extends State<MyInfoPage>{
  final MineController control = Get.put(MineController());
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    control.getInfos(context);
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Obx(()=>Container(
      child: Column(
        children: [
          Container(
            height: 15,
            color: Color(0xff1A4677),
          ),
          SizedBox(height: 50,),
          Container(
            margin: EdgeInsets.only(left: 30),
            child:  Row(
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text("基本信息",style: TextStyle(color: Color(0xff2E2F33),fontSize: 24)),
                    SizedBox(height: 20,),
                    Row(
                      children: [
                        Text("账号",style: TextStyle(color: Color(0xff2E2F33),fontSize: 14)),
                        SizedBox(width: 35,),
                        Text(CommonUtils.isNull(control.myinfoBean.value?.phone),style: TextStyle(color: Color(0xff8A8C99),fontSize: 14)),
                      ],
                    ),
                    SizedBox(height: 20,),
                    Row(
                      children: [
                        Text("角色",style: TextStyle(color: Color(0xff2E2F33),fontSize: 14)),
                        SizedBox(width: 35,),
                        Text(control.myinfoBean.value?.parentId==0?"主账号":"子账号",style: TextStyle(color: Color(0xff8A8C99),fontSize: 14)),
                      ],
                    ),
                    SizedBox(height: 20,),
                    Row(
                      children: [
                        Text("姓名",style: TextStyle(color: Color(0xff2E2F33),fontSize: 14)),
                        SizedBox(width: 35,),
                        Text(CommonUtils.isNull(control.myinfoBean.value?.username),style: TextStyle(color: Color(0xff8A8C99),fontSize: 14)),
                      ],
                    ),
                    SizedBox(height: 20,),
                    Row(
                      children: [
                        Text("公司",style: TextStyle(color: Color(0xff2E2F33),fontSize: 14)),
                        SizedBox(width: 35,),
                        Text(CommonUtils.isNull(control.myinfoBean.value?.companyName),style: TextStyle(color: Color(0xff8A8C99),fontSize: 14)),
                      ],
                    )
                  ],
                ),
                Spacer(flex: 1,),
                Container(
                  margin: EdgeInsets.only(left: 30),
                  child: Column(
                    children: [
                      Text("账户余额",style: TextStyle(color: Color(0xff2E2F33),fontSize: 24)),
                      SizedBox(height: 30,),
                      Text("￥"+CommonUtils.isNull(control.myinfoBean.value?.credit),style: TextStyle(color: Color(0xffF2502C),fontSize: 14)),
                      SizedBox(height: 5,),
                      Text("账户可用余额",style: TextStyle(color: Color(0xff8A8C99),fontSize: 14)),
                      SizedBox(height: 20,),
                      Text(CommonUtils.isNull(control.myinfoBean.value?.freezeAmount),style: TextStyle(color: Color(0xff5C5E66),fontSize: 14)),
                      SizedBox(height: 5,),
                      Text("待核销金额",style: TextStyle(color: Color(0xff8A8C99),fontSize: 14)),
                    ],
                  ),
                ),
                Spacer(flex: 1,),
              ],
            ),
          )
        ],
      ),
    ));
  }

}